package com.tnl.app.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.tnl.app.entity.RecommendRecord;
import com.tnl.base.BaseDAO;

@Repository
public class RecommendRecordDAO {
	
	private static final String SQL_GET_ALL = "select * from tb_recommend_record where recommendId=? order by createTime desc";
	private static final String SQL_INSERT = " insert into tb_recommend_record(recommendId,status,remark,createTime)"
			+ " values(?,?,?,?)";
	
	public static enum Status {
		wait, start, processing, completed, rejected,accepted,cancelled
	}
	
	public List<RecommendRecord> getALL(int id) {
		return BaseDAO.queryForList(RecommendRecord.class, SQL_GET_ALL,id);
	}

	public Long save(RecommendRecord recommendRecord) {
		return BaseDAO.save( SQL_INSERT, recommendRecord.getRecommendId(),
				recommendRecord.getStatus(),recommendRecord.getRemark(),recommendRecord.getCreateTime());
	}
	
}
